home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.0 / PInterfaces / AppleScript.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  5.8 KB  |  200 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleScript.p
  3.  
  4.      Contains:    AppleScript Specific Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT AppleScript;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __APPLESCRIPT__}
  30. {$SETC __APPLESCRIPT__ := 1}
  31.  
  32. {$I+}
  33. {$SETC AppleScriptIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __ERRORS__}
  38. {$I Errors.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __APPLEEVENTS__}
  43. {$I AppleEvents.p}
  44. {$ENDC}
  45. {    Types.p                                                        }
  46. {    Memory.p                                                    }
  47. {        MixedMode.p                                                }
  48. {    OSUtils.p                                                    }
  49. {    Events.p                                                    }
  50. {        Quickdraw.p                                                }
  51. {            QuickdrawText.p                                        }
  52. {    EPPC.p                                                        }
  53. {        AppleTalk.p                                                }
  54. {        Files.p                                                    }
  55. {        PPCToolbox.p                                            }
  56. {        Processes.p                                                }
  57. {    Notification.p                                                }
  58.  
  59. {$IFC UNDEFINED __OSA__}
  60. {$I OSA.p}
  61. {$ENDC}
  62. {    AEObjects.p                                                    }
  63. {    Components.p                                                }
  64.  
  65. {$IFC UNDEFINED __TEXTEDIT__}
  66. {$I TextEdit.p}
  67. {$ENDC}
  68.  
  69. {$PUSH}
  70. {$ALIGN MAC68K}
  71. {$LibExport+}
  72.  
  73. CONST
  74.     typeAppleScript                = 'ascr';
  75.     kAppleScriptSubtype            = typeAppleScript;
  76.     typeASStorage                = typeAppleScript;
  77.  
  78. {*************************************************************************
  79.     Component Selectors
  80. *************************************************************************}
  81.     kASSelectInit                = $1001;
  82.     kASSelectSetSourceStyles    = $1002;
  83.     kASSelectGetSourceStyles    = $1003;
  84.     kASSelectGetSourceStyleNames = $1004;
  85.  
  86. {*************************************************************************
  87.     OSAGetScriptInfo Selectors
  88. *************************************************************************}
  89.     kASHasOpenHandler            = 'hsod';
  90.  
  91. {
  92.         This selector is used to query a context as to whether it contains
  93.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  94.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  95.         there is no kAEOpenDocuments handler, and returns the error value 
  96.         errOSAInvalidAccess if the input is not a context.
  97.     }
  98. {*************************************************************************
  99.     Initialization
  100. *************************************************************************}
  101.  
  102. FUNCTION ASInit(scriptingComponent: ComponentInstance; modeFlags: LONGINT; minStackSize: LONGINT; preferredStackSize: LONGINT; maxStackSize: LONGINT; minHeapSize: LONGINT; preferredHeapSize: LONGINT; maxHeapSize: LONGINT): OSAError;
  103.     {$IFC NOT GENERATINGCFM}
  104.     INLINE $2F3C, $1C, $1001, $7000, $A82A;
  105.     {$ENDC}
  106. {
  107.         ComponentCallNow(kASSelectInit, 28);
  108.         This call can be used to explicitly initialize AppleScript.  If it is
  109.         not called, the a scripting size resource is looked for and used. If
  110.         there is no scripting size resource, then the constants listed below
  111.         are used.  If at any stage (the init call, the size resource, the 
  112.         defaults) any of these parameters are zero, then parameters from the
  113.         next stage are used.  ModeFlags are not currently used.
  114.         Errors:
  115.         errOSASystemError        initialization failed
  116.     }
  117. {
  118.     These values will be used if ASInit is not called explicitly, or if any
  119.     of ASInit's parameters are zero:
  120. }
  121.  
  122. CONST
  123.     kASDefaultMinStackSize        = 4 * 1024;
  124.     kASDefaultPreferredStackSize = 16 * 1024;
  125.     kASDefaultMaxStackSize        = 16 * 1024;
  126.     kASDefaultMinHeapSize        = 4 * 1024;
  127.     kASDefaultPreferredHeapSize    = 16 * 1024;
  128.     kASDefaultMaxHeapSize        = 32 * 1024 * 1024;
  129.  
  130. {*************************************************************************
  131.     Source Styles
  132. *************************************************************************}
  133.  
  134. FUNCTION ASSetSourceStyles(scriptingComponent: ComponentInstance; sourceStyles: STHandle): OSAError;
  135.     {$IFC NOT GENERATINGCFM}
  136.     INLINE $2F3C, $4, $1002, $7000, $A82A;
  137.     {$ENDC}
  138. {
  139.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  140.         Errors:
  141.         errOSASystemError        operation failed
  142.     }
  143. FUNCTION ASGetSourceStyles(scriptingComponent: ComponentInstance; VAR resultingSourceStyles: STHandle): OSAError;
  144.     {$IFC NOT GENERATINGCFM}
  145.     INLINE $2F3C, $4, $1003, $7000, $A82A;
  146.     {$ENDC}
  147. {
  148.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  149.         Errors:
  150.         errOSASystemError        operation failed
  151.     }
  152. FUNCTION ASGetSourceStyleNames(scriptingComponent: ComponentInstance; modeFlags: LONGINT; VAR resultingSourceStyleNamesList: AEDescList): OSAError;
  153.     {$IFC NOT GENERATINGCFM}
  154.     INLINE $2F3C, $8, $1004, $7000, $A82A;
  155.     {$ENDC}
  156. {
  157.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  158.         This call returns an AEList of styled text descriptors the names of the
  159.         source styles in the current dialect.  The order of the names corresponds
  160.         to the order of the source style constants, below.  The style of each
  161.         name is the same as the styles returned by ASGetSourceStyles.
  162.         
  163.         Errors:
  164.         errOSASystemError        operation failed
  165.     }
  166. {
  167.     Elements of STHandle correspond to following categories of tokens, and
  168.     accessed through following index constants:
  169. }
  170.  
  171. CONST
  172.     kASSourceStyleUncompiledText = 0;
  173.     kASSourceStyleNormalText    = 1;
  174.     kASSourceStyleLanguageKeyword = 2;
  175.     kASSourceStyleApplicationKeyword = 3;
  176.     kASSourceStyleComment        = 4;
  177.     kASSourceStyleLiteral        = 5;
  178.     kASSourceStyleUserSymbol    = 6;
  179.     kASSourceStyleObjectSpecifier = 7;
  180.     kASNumberOfSourceStyles        = 8;
  181.  
  182. { Gestalt selectors for AppleScript }
  183.     gestaltAppleScriptAttr        = 'ascr';
  184.     gestaltAppleScriptVersion    = 'ascv';
  185.  
  186.     gestaltAppleScriptPresent    = 0;
  187.     gestaltAppleScriptPowerPCSupport = 1;
  188.  
  189.  
  190. {$ALIGN RESET}
  191. {$POP}
  192.  
  193. {$SETC UsingIncludes := AppleScriptIncludes}
  194.  
  195. {$ENDC} {__APPLESCRIPT__}
  196.  
  197. {$IFC NOT UsingIncludes}
  198.  END.
  199. {$ENDC}
  200.